Skip to content

Conversation

@ubfx
Copy link
Member

@ubfx ubfx commented Oct 20, 2024

I've upstreamed the necessary quantized linalg Op with the "channel-first" ordering used by torch (llvm/llvm-project#107740) for 2d convolution.

This patch changes the lowering for the quantized 2d case of aten.convolution accordingly, which saves three transpositions per convolution (input, weights, result) and therefore removes the requirement to try to optimize these away in downstream passes.

@ubfx
Copy link
Member Author

ubfx commented Oct 20, 2024

I'm upstreaming the necessary linalg ops for the conv 3d and depthwise cases into MLIR next.

Copy link
Collaborator

@zjgarvey zjgarvey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice.

@ubfx
Copy link
Member Author

ubfx commented Oct 21, 2024

I'm not merging this yet because I noticed that all of the Quantized Conv2D E2E tests are currently not properly evaluated (i.e. they're all in the XFAIL set), because the fx_importer frontend can't deal with it.

@zjgarvey
Copy link
Collaborator

Are we no longer running the old importer path in the CI? You should at least be able to test locally with that path.

@zjgarvey
Copy link
Collaborator

Yeah, try running this locally:

projects/pt1/tools/e2e_test.sh -f Conv2dQInt8Module_basic -v

It should print off IR for that example.

Then I'd check all the Conv2dQ tests with.

projects/pt1/tools/e2e_test.sh -f Conv2dQ -v

@ubfx
Copy link
Member Author

ubfx commented Oct 21, 2024

Are we no longer running the old importer path in the CI?

No seems like only onnx and fx_importer are now run on CI.

You should at least be able to test locally with that path.

Yeah I was able to test locally but it seems dangerous to not have the quantized tests done on CI at all. By now, I also retired the jit_ir_importer locally, though. Seems like this is a good opportunity to move the quantized tests over to the DQ/Q paradigm which we use everywhere else: #3809

I've upstreamed the necessary quantized linalg Op with the "channel-first"
ordering used by torch (llvm/llvm-project#107740)
for 2d convolution.

This patch changes the lowering for the quantized 2d case of `aten.convolution`
accordingly, which saves three transpositions per convolution (input,
weights, result) and therefore removes the requirement to try to optimize
these away in downstream passes.
@ubfx ubfx merged commit aca33f1 into llvm:main Oct 22, 2024
3 checks passed
@ubfx ubfx deleted the conv2d-q-new-op branch October 24, 2024 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants